import Mock from 'mockjs2'
import { builder } from '../util'

//
const demo = (parmas) => {
  let body = JSON.parse(parmas.body)
  console.log('mock---list--parmas', parmas)
  return builder({
    pageNo: body.pageNo,
    totalCount: 100,
    data: [
      { name: 'www', age: 10, id: 1 },
      { name: 'www', age: 10, id: 2 },
      { name: 'www', age: 10, id: 3 },
      { name: 'www', age: 10, id: 4 },
      { name: 'www', age: 10, id: 5 },
      { name: 'www', age: 10, id: 6 },
      { name: 'www', age: 10, id: 7 },
      { name: 'www', age: 10, id: 8 },
      { name: 'www', age: 10, id: 9 },
      { name: 'www', age: 10, id: 10 },
      { name: 'www', age: 10, id: 21 },
      { name: 'www', age: 10, id: 32 },
      { name: 'www', age: 10, id: 13 },
      { name: 'www', age: 10, id: 24 },
      { name: 'www', age: 10, id: 35 }
    ]
  })
}

Mock.mock(/\/demo\/list/, 'post', demo)
